<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.ce.util.*" %>
<%@ page import="com.ce.framework.context.*" %>
<%@ page import="com.ce.framework.util.*" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<%@ include file="/common/common.jsp"%>
<title>无标题文档</title>
<style>
textarea{width:100%;height:80px;display:none;}
div{margin-top:150px;width:100%;font-size:30px;text-align:center;color:gray;}
</style>
<s:form>
<s:textarea name="targetId" id="targetId"/>
<s:textarea name="targetName" id="targetName"/>
<s:textarea name="targetUrl" id="targetUrl"/>
<s:textarea name="backFun" id="backFun"/>
<s:textarea name="fileIds" id="fileIds"/>
<s:textarea name="fileNames" id="fileNames"/>
<s:textarea name="fileUrls" id="fileUrls"/>
<s:textarea name="backFun" id="backFun"/>
<div>文件上传成功！</div>
<br>
<s:property value="#request.msg"/>
</s:form>
<script language="javascript">
setTimeout(onLoad,1500);

  	function onLoad(){
		var opennew = window==top;
		var doc = opennew?window.opener.document:parent.document;
		var win = opennew?window.opener:parent;
      	var targetId = $('#targetId').val();
      	var targetName = $('#targetName').val();
      	var targetUrl = $('#targetUrl').val();
      	idValues = $('#fileIds').val();
      	nameValues = $('#fileNames').val();
      	urlValues = $('#fileUrls').val();
	    try{
	      	if(targetId!=''){
		      	doc.getElementById(targetId).value=idValues;
		    }
	      	if(targetName!=''){
	      		if(doc.getElementById(targetName))
		        	doc.getElementById(targetName).value=nameValues;
		    }
	      	if(targetUrl!=''){
		        doc.getElementById(targetUrl).value=urlValues;
				doc.getElementById(targetUrl).innerHTML=urlValues;
				
		    }
		}catch(e){;}
		try{
	      	if(targetId!=''){
		      	var fun = eval("win."+targetId);
		      	fun(idValues);
		    }
		}catch(e){;}
		try{
	      	if(targetName!=''){
		      	var fun = eval("win."+targetName);
		      	fun(nameValues);
		    }
		}catch(e){;}
		try{
	      	if(targetUrl!=''){
		      	var fun = eval("win."+targetUrl);
		      	fun(urlValues);
		    }
		}catch(e){;}
		if(opennew)window.close();
		else parent.hideUploadWindow();
		try{
		    if(window.parent.parent!=null){
			window.parent.parent.rload();
			window.parent.cancel();		
		}
		}catch(e){;}
		
  }

</script>
</head>

</html>
